A multichassis link aggregation group (also referred to as M-LAG) is a multichassis layer 2 port virtualization technology. This technology allows performing multichassis link aggregation on a user-side device and two devices that form active-active gateways, and improves service reliability of the user-side device. The user-side device may be a relay device providing a data forwarding function, or may be lower-layer user device.
As shown in FIG. 1, FIG. 1 is a network topology to which an M-LAG technology is applied. A layer 3 switch A and a layer 3 switch B are multichassis link aggregation devices, and the two switches form active-active gateways. A server E and a server D are user-side devices, and the two servers are dual-homed to the switch A and the switch B. The switch A and the switch B each provide an M-LAG interface (not shown in the figure) externally, and are separately connected to the server E and the server D using the M-LAG interface. Dual-homing means that a server is connected to two different gateways. Active-active means that both two gateways can be used for traffic forwarding. Further, a peer-link link (peer link) is deployed between the switch A and the switch B to forward horizontal service traffic between the switch A and the switch B. Ports, connected to the peer link, of the switch A and the switch B are both peer-link ports. In the foregoing network topology, the server E and the server D are connected to a network in a manner of multichassis link aggregation, to implement dual-homed and active-active access of the server E and the server D.
As shown in FIG. 1, the switch A and the switch B form active-active gateways, and therefore uplink traffic of the server E or the server D can arrive at the switch C and an uplink network regardless of whether the uplink traffic passes through the switch A or the switch B. When a link fault occurs on one device in the active-active gateways, for example, a link between the switch A and the server E becomes faulty, downlink traffic destined for the server E and received by the switch C may be switched to the switch B using a peer link after being forwarded to the switch A, and then arrives at the server E through layer 2 forwarding by the switch B. It can be learned that when a link fault occurs on one device of the active-active gateways, normal service operation can be ensured using the other device, thereby effectively improving communication reliability of a network structure formed using the M-LAG technology.
However, in the network shown in FIG. 1, when the link between the switch A and the server E becomes faulty, the switch A continues to send data to the server E using an M-LAG port of the switch A and the link between the switch A and the server E in a period of time. Therefore, packet loss is caused.
In addition, in a dual-homed and active-active status, to avoid a loop, it is specified that the switch B cannot forward traffic that is received on a peer link, that is, the switch B cannot perform layer 2 forwarding. When a link fault is recovered, for example, when the link between the switch A and the server E becomes normal, the switch B cannot perform layer 2 forwarding any longer. However, the switch A cannot normally forward data to the server E in a period of time, and packet loss consequently occurs in this period of time.
In conclusion, in a network formed using the M-LAG technology, how to reduce a quantity of lost data packets when a link fault occurs and the link fault is recovering is a technical problem that needs to be urgently resolved.